const express = require('express')
const router = express.Router()

router.get('/get', (req, res) => {
    const query = req.query
    console.log('req:>>> ', query)
    res.send({
        status: 0,
        msg: 'get请求成功',
        data: query
    })
})

router.post('/post', (req, res) => {
    const body = req.body
    res.send({
        status: 0,
        msg: 'post请求成功',
        data: body
    })
})

// router.get('/jsonp', (req, res) => {
//     const query = req.query
//     const { callback } = query
//     res.send(`${callback}(${JSON.stringify({
//         status: 0,
//         msg: 'jsonp请求成功',
//         data: query
//     })})`)
// })
module.exports = router